import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/outBoundOrderDetail',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/outBoundOrderDetail/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/outBoundOrderDetail',
    method: 'put',
    data
  })
}

// list1API
export function getListOneAPI(params) {
  return request({
    url: 'api/productOutBoundOrderDetail/selectByProductOutBoundId',
    method: 'get',
    params
  })
}

// list2API
export function getListTwoAPI(params) {
  return request({
    url: 'api/productOutBoundOrder/selectDetailByOutBoundId',
    method: 'get',
    params
  })
}

// 计算需要出库的母托
export function computedAPI(params) {
  return request({
    url: '/api/productOutBoundOrder/calculateOutBound',
    method: 'get',
    params
  })
}

// 取消计算
export function cancelComputedAPI(params) {
  return request({
    url: '/api/productOutBoundOrder/cancelCalculateOutBound',
    method: 'get',
    params
  })
}

// 根据出库单查询是否计算了
export function checkCalcaluateAPI(params) {
  return request({
    url: '/api/productOutBoundOrder',
    method: 'get',
    params
  })
}

export default { add, edit, del }
